package servlet;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;

import common.Property;
import common.SkillManSchema;

public class insertOntology extends HttpServlet {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		HttpSession session = request.getSession(true); 

		System.out.println(request.getParameter("parent") + " "+ request.getParameter("child"));
		SkillManSchema r=new SkillManSchema();
		r.setCWD(Property.skillMgmHome);
		r.load();
		
		r.addSkill(request.getParameter("parent"), request.getParameter("child"), request.getParameter("comment"));
		try {
			r.store();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		RequestDispatcher dispatcher = request.getRequestDispatcher("index.jsp");
		dispatcher.forward(request, response);
	}

	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		doGet(request, response);
	}
}
